package com.gimi.cloud.jimi.queue.service.log.impl;

import com.gimi.cloud.jimi.common.utils.MyBeanUtils;
import com.gimi.cloud.jimi.dao.dao.log.LogOperationDao;
import com.gimi.cloud.jimi.dto.log.LogOperationDTO;
import com.gimi.cloud.jimi.entity.log.LogOperationEntity;
import com.gimi.cloud.jimi.queue.service.log.LogOperationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 操作日志相关接口实现类
 * @author wbj
 * @version 1.0
 * @Description
 * @create 2018-02-07
 **/
@Service
public class LogOperationServiceImpl implements LogOperationService {
    private static final Logger logger = LoggerFactory.getLogger(LogOperationServiceImpl.class);

    private LogOperationDao logOperationDao;

    @Autowired
    public LogOperationServiceImpl(LogOperationDao logOperationDao) {
        this.logOperationDao = logOperationDao;
    }

    @Override
    public int saveOperationLog(LogOperationDTO dto) {
        LogOperationEntity logOperationEntity = new LogOperationEntity();
        MyBeanUtils.copyPropertiesIgnoreNullAndEmptyStr(dto,logOperationEntity);
        return logOperationDao.baseInsert(logOperationEntity);
    }
}
